<?php
/* * **************************************************************************************\
 * *   @name		EXP Autos  2.0                                                  **
 * *   @package          Joomla 1.6                                                      **
 * *   @author		EXP TEAM::Alexey Kurguz (Grusha)                                **
 * *   @copyright	Copyright (C) 2005 - 2011  EXP TEAM::Alexey Kurguz (Grusha)     **
 * *   @link             http://www.feellove.eu                                          **
 * *   @license		Commercial License                                              **
 \*************************************************************************************** */

//no direct access
defined('_JEXEC') or die;

$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . 'modules/mod_expautospro_images/css/mod_expautospro_images_google.css');
$expconfig = ExpAutosProExpparams::getExpParams('config', 1);
$thumbsize = $expconfig->get('c_images_thumbsize_width');
$moduleid = $module->id;
$image_path = JURI::root() . 'modules/mod_expautospro_images/images/';
?>
<style type="text/css">
#modexpimages <?php echo  $moduleid ;  ?> table.expautos_images_table td.expautos_images_images a
	{
	color: #000;
}

#modexpimages <?php echo  $moduleid ;  ?> table.expautos_images_table td.expautos_images_images a:hover
	{
	color: #0055BB;
}
</style>
<table>
	<tr>
		<td>
			<div id="modexpimages<?php echo $moduleid; ?>"
				class="modexpimages expimages<?php echo $moduleclass_sfx; ?>">
				<center>
					<ul class="google-module-images-car">
					<?php
					$c = 0;
					$kr = $params->get('expcolumnimg');
					$countshortlist = count($expimages);
					for ($i = 0, $n = $countshortlist; $i < $n; $i++):
					$imgclass = null;
					if ($params->get('showimgicons')) {
						/* New ads */
						$date_range = time() - ($expconfig->get('c_admanager_lspage_newdate') * 24 * 60 * 60);
						$zc_new_date = date('Ymd', $date_range);
						if (date('Ymd', strtotime($expimages[$i]->creatdate)) >= $zc_new_date) {
							$newdateclass = "newdate";
						} else {
							$newdateclass = "";
						}

						if ($expimages[$i]->fcommercial) {
							$imgclass = "commercial";
						} elseif ($expimages[$i]->ftop) {
							$imgclass = "top";
						} elseif ($expimages[$i]->special) {
							$imgclass = "special";
						} elseif (isset($expimages[$i]->solid)) {
							$imgclass = "solid";
						}
					}
					?>
					<?php if (($c % $kr) == 0): ?>


					<?php endif; ?>
					<?php
					if ($expimages[$i]->img_name) {
						$imglink = ExpAutosProExpparams::ImgUrlPatchThumbs() . $expimages[$i]->img_name;
					} else {
						$imglink = ExpAutosProExpparams::ImgUrlPatch() . 'assets/images/no_photo.jpg';
					}
					$price = ExpAutosProExpparams::price_formatdata($expimages[$i]->price, 1);
					$link = JRoute::_("index.php?option=com_expautospro&amp;view=expdetail&amp;id=" . $expimages[$i]->adid . "&amp;catid=" . $expimages[$i]->categid . "&amp;makeid=" . $expimages[$i]->mkid . "&amp;modelid=" . $expimages[$i]->mdid . "&amp;Itemid=" . $itemid);
					?>
						<li>
							<div class="google-car-gallery-item">
							
								<div class="item-title">
									
									<div class="make_name" >
			        						<span class="name-car-no-boder">
			        								<a href="<?php echo $link; ?>">
			                                            <?php if ($expimages[$i]->make_name): ?>
			                                                <?php echo $expimages[$i]->make_name; ?>
			                                            <?php endif; ?>
			                                     	</a>
			                                     	&nbsp;
			                                     	<a href="<?php echo $link; ?>">
			                                             <?php if ($expimages[$i]->model_name): ?>
			                                                <?php echo $expimages[$i]->model_name; ?>
			                                            <?php endif; ?>
			                                     	</a>
			        						</span>
			        						<span class="model-car right" style="display: none">
			        								<a href="<?php echo $link; ?>">
			                                             <?php if ($expimages[$i]->model_name): ?>
			                                                <?php echo $expimages[$i]->model_name; ?>
			                                            <?php endif; ?>
			                                     	</a>
			        						</span>
			        						<span style="display: none" >
			        								<a href="<?php echo $link; ?>">
			                                            <?php if ($expimages[$i]->specificmodel): ?>
			                                                <?php echo $expimages[$i]->specificmodel; ?>
			                                            <?php endif; ?>
			                                     	</a>
			        						</span>
				        				
			        					</div>
			        					
			        					<div class="google-top" >
			        						<?php if ($expimages[$i]->year > 0): ?>
				                                 <span class="toolbar"><?php echo $expimages[$i]->year; ?></span>
				                             <?php endif; ?>
				                             
	                                         <?php if ($expimages[$i]->mileage): ?>
	                                            <span class="toolbar" title="<?php echo JText::_('COM_EXPAUTOSPRO_CP_LIST_TABLE_MILEAGE_TEXT'); ?>"><?php echo((int)$expimages[$i]->mileage/1000 . "'&nbsp;" . JText::_('COM_EXPAUTOSPRO_KM_TEXT')); ?></span>
	                                        <?php endif; ?>
	                                        
	                                       
	                                        <?php if ($expimages[$i]->engine): ?>
                                              <!--   <span class="toolbar"><?php echo $expimages[$i]->engine . " " . JText::_('COM_EXPAUTOSPRO_KW_TEXT'); ?></span>  -->
                                            <?php endif; ?>
	                                        
	                                        <?php if ($expimages[$i]->drive_name): ?>
                                            <span class="toolbar" title="<?php echo JText::_('COM_EXPAUTOSPRO_CP_LIST_TABLE_DRIVE_TEXT'); ?>"><?php echo $expimages[$i]->drive_name; ?></span> 
                                        	<?php endif; ?>
	                                        
	                                        <?php if ($expimages[$i]->fuel_code): ?>
	                                            <span class="toolbar-last" title="<?php echo (string) $expimages[$i]->fuel_name; ?>"><?php echo (string) $expimages[$i]->fuel_code; ?></span>
	                                        <?php else: ?>
	                                            <span class="toolbar-last"><?php echo (string) $expimages[$i]->fuel_name; ?></span>
	                                        <?php endif; ?> 
			                                    
			                               
			        					</div>
			        					
								</div>
								
								<div class="item-thumbnail">
											<img src="<?php echo $imglink; ?>" />
								</div>
								
								<div class="item-description">
										<?php if ($expimages[$i]->bodytype_name): ?>
                                            	<span class="toolbar3 left" title="<?php echo JText::_('COM_EXPAUTOSPRO_CP_LIST_TABLE_BODYTYPE_TEXT'); ?>"><?php echo $expimages[$i]->bodytype_name; ?></span>
                                        <?php endif; ?>
                                        <?php if ($expimages[$i]->bodytype_name): ?>
                                            	<span class="toolbar3 right" title="<?php echo JText::_('COM_EXPAUTOSPRO_CP_LIST_TABLE_BODYTYPE_TEXT'); ?>"><?php echo $expimages[$i]->bodytype_name; ?></span>
                                        <?php endif; ?>
										
								</div>

							</div>
							
							<div class="google-footer" >
		        				<div class="google-bottom" >
									<?php if ($params->get('showprice')): ?>
                                    <span class="toolbar-price left">
                                        <?php
                                        $price = ExpAutosProExpparams::price_formatdata($expimages[$i]->price);
                                        echo "Price: ".$expimages[$i]->price." EUR" ;
                                        ?>
                                    </span>
                                <?php endif; ?>
                                	<span class="toolbar right"> <img class="img-add-shortlist wigth100" src="<?php echo($image_path.'icon-add-list_03.png')?>" /></span>
								</div>
		        			</div>
						</li>
						<?php
						$c++;
						endfor;
						?>
					</ul>
				</center>
			</div>
		</td>
	</tr>

</table>

